#include <gui/events/SpyMouse.h>

#include <QMouseEvent>
#include <QImage>
#include <QLabel>
#include <QPoint>

#include <iostream>

#include <core/ApplicationResources.h>

bool SpyMouse::eventFilter(QObject * object, QEvent * event) {
    if(event->type() == QEvent::MouseMove) {
        QMouseEvent * mouseEvent = static_cast<QMouseEvent *>(event);

        out << "x: " << mouseEvent->pos().x() << " y: " << mouseEvent->pos().y() << std::endl;

        QLabel cursorLabel("");
        cursorLabel.setPixmap(QPixmap::fromImage(QImage(ApplicationResources::images::OPENED_CURSOR_IMAGE)));
        cursorLabel.adjustSize();



        return true;
    } else {
        return QObject::eventFilter(object, event);
    }
}
